//  package cn.org.intelli.zffserver.controller;
//
//
//  import cn.org.intelli.zffserver.domain.BackBean;
//  import cn.org.intelli.zffserver.entity.ExecutorJarEntity;
//  import cn.org.intelli.zffserver.entity.ExecutorProgramEntity;
//  import cn.org.intelli.zffserver.repository.ExecutorJarRepository;
//import cn.org.intelli.zffserver.repository.ExecutorProgramRepository;
//import cn.org.intelli.zffserver.util.Uid;
//  import com.alibaba.fastjson.JSON;
//  import com.alibaba.fastjson.JSONArray;
//  import com.alibaba.fastjson.JSONObject;
//  import dm.jdbc.util.StringUtil;
//  import java.util.*;
//
//
//
//
//  import org.slf4j.Logger;
//  import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//  import org.springframework.data.repository.query.Param;
//  import org.springframework.web.bind.annotation.*;
//
//
//
//
//  import org.springframework.web.multipart.MultipartFile;
//
//  @RestController
//  @RequestMapping({"/executorJar"})
//  public class ExecutorJarController {
///*  28 */   private static final Logger log = LoggerFactory.getLogger(cn.org.intelli.zffserver.controller.ExecutorJarController.class);
//
//
//
//    @Autowired
//    private ExecutorJarRepository executorJarRepository;
//
//
//    @Autowired
//    private ExecutorProgramRepository executorProgramRepository;
//
//
//
//    @PostMapping({"/createExecutorProgram"})
//    public JSONObject createExecutorProgram(@RequestBody ExecutorProgramEntity program) {
//      try {
///*  44 */       String executorJarId = program.getExecutorJarId();
///*  45 */       if (StringUtil.isEmpty(executorJarId)) {
///*  46 */         throw new Exception("未配置执行器文件");
//        }
///*  48 */       String id = Uid.generateShortUuid();
///*  49 */       program.setId(id);
///*  50 */       this.executorProgramRepository.save(program);
///*  51 */       return BackBean.builder().status(true).data("success").build();
///*  52 */     } catch (Exception e) {
///*  53 */       e.printStackTrace();
///*  54 */       log.error("@CreateExecutorProgram: error is {}", e.getMessage());
///*  55 */       return BackBean.builder().status(false).message(e.getMessage()).build();
//      }
//    }
//
//
//
//
//
//
//    @GetMapping({"/getProgramDetail"})
//    public BackBean<ExecutorProgramEntity> getProgramDetail(@RequestParam("programId") String programId) {
//      try {
///*  67 */       ExecutorProgramEntity program = this.executorProgramRepository.findById(programId).get();
///*  68 */       return BackBean.builder().status(true).data(program).build();
///*  69 */     } catch (Exception e) {
///*  70 */       e.printStackTrace();
///*  71 */       log.error("@GetProgramDetail: error is {}", e.getMessage());
///*  72 */       return BackBean.builder().status(false).message(e.getMessage()).build();
//      }
//    }
//
//
//
//
//
//
//    @PostMapping({"/deleteExecutorProgram/{programId}"})
//    public BackBean<String> deleteExecutorProgram(@PathVariable("programId") String programId) {
//      try {
///*  84 */       this.executorProgramRepository.deleteById(programId);
///*  85 */       return BackBean.builder().status(true).data("success").build();
///*  86 */     } catch (Exception e) {
///*  87 */       e.printStackTrace();
///*  88 */       log.error("@DeleteExecutorProgram: error is {}", e.getMessage());
///*  89 */       return BackBean.builder().status(false).message(e.getMessage()).build();
//      }
//    }
//
//
//
//
//
//    @GetMapping({"/getAllExecutorProgram"})
//    public BackBean<JSONArray> getAllExecutorProgram() {
//      try {
///* 100 */       List<ExecutorProgramEntity> programs = this.executorProgramRepository.findAll();
///* 101 */       Set<String> executorJarIds = new HashSet<>();
///* 102 */       programs.forEach(program -> executorJarIds.add(program.getExecutorJarId()));
//
//
///* 105 */       List<String> jarIdList = new ArrayList<>(executorJarIds);
///* 106 */       List<ExecutorJarEntity> jars = this.executorJarRepository.findAllByIdIn(jarIdList);
///* 107 */       Map<String, ExecutorJarEntity> jarCache = new HashMap<>();
///* 108 */       jars.forEach(jar -> jarCache.put(jar.getId(), jar));
//
//
///* 111 */       JSONArray result = new JSONArray();
///* 112 */       programs.forEach(program -> {
//              JSONObject atom = JSON.parseObject(JSON.toJSONString(program));
//              atom.put("jarInfo", jarCache.get(program.getExecutorJarId()));
//              result.add(atom);
//            });
///* 117 */       return BackBean.builder().status(true).data(result).build();
///* 118 */     } catch (Exception e) {
///* 119 */       e.printStackTrace();
///* 120 */       log.error("@GetAllExecutorProgram: error is {}", e.getMessage());
///* 121 */       return BackBean.builder().status(false).message(e.getMessage()).build();
//      }
//    }
//
//
//
//
//
//
//
//    @GetMapping({"/getExecutorProgramList"})
//    public BackBean<List> getExecutorProgramList(@Param("executorJarId") String executorJarId) {
//      try {
///* 134 */       List<ExecutorProgramEntity> programs = this.executorProgramRepository.findAllByExecutorJarId(executorJarId);
///* 135 */       return BackBean.builder().status(true).data(programs).build();
///* 136 */     } catch (Exception e) {
///* 137 */       e.printStackTrace();
///* 138 */       log.error("@GetExecutorProgramList: error is {}", e.getMessage());
///* 139 */       return BackBean.builder().status(false).message(e.getMessage()).build();
//      }
//    }
//
//
//
//
//
//
//
//
//
//    @PostMapping({"/updateExecutorProgram/{programId}"})
//    public BackBean<String> updateExecutorProgram(@PathVariable("programId") String programId, @RequestBody ExecutorProgramEntity program) {
//      try {
///* 154 */       ExecutorProgramEntity oriProgram = this.executorProgramRepository.findById(programId).get();
///* 155 */       if (StringUtil.isNotEmpty(program.getExecutorName())) {
///* 156 */         oriProgram.setExecutorName(program.getExecutorName());
//        }
///* 158 */       if (StringUtil.isNotEmpty(program.getDescription())) {
///* 159 */         oriProgram.setDescription(program.getDescription());
//        }
///* 161 */       if (StringUtil.isNotEmpty(program.getTag())) {
///* 162 */         oriProgram.setTag(program.getTag());
//        }
///* 164 */       this.executorProgramRepository.save(oriProgram);
///* 165 */       return BackBean.builder().status(true).data("success").build();
///* 166 */     } catch (Exception e) {
///* 167 */       e.printStackTrace();
///* 168 */       log.error("@UpdateExecutorProgram: error is {}", e.getMessage());
///* 169 */       return BackBean.builder().status(false).message(e.getMessage()).build();
//      }
//    }
//
//
//
//
//
//
//    @PostMapping({"/createExecutorJar"})
//    public BackBean<String> createExecutorJar(@RequestBody ExecutorJarEntity executorJarEntity) {
//      try {
///* 181 */       String id = Uid.generateShortUuid();
///* 182 */       executorJarEntity.setId(id);
///* 183 */       this.executorJarRepository.save(executorJarEntity);
///* 184 */       return BackBean.builder().status(true).data("success").build();
///* 185 */     } catch (Exception e) {
///* 186 */       e.printStackTrace();
///* 187 */       log.error("@CreateExecutorJarRepository: error is {}", e.getMessage());
///* 188 */       return BackBean.builder().status(false).message(e.getMessage()).build();
//      }
//    }
//
//
//
//
//
//
//
//
//
//
//
//
//
//    @PostMapping({"/createExecutorJar2"})
//    public BackBean<String> createExecutorJar2(@Param("record") String record, @RequestParam("file") MultipartFile file) {
//      try {
///* 207 */       String fileName = file.getOriginalFilename();
//
///* 209 */       ExecutorJarEntity jar = new ExecutorJarEntity();
///* 210 */       String id = Uid.generateShortUuid();
///* 211 */       jar.setId(id);
///* 212 */       jar.setName(fileName);
///* 213 */       if (StringUtil.isNotEmpty(record)) {
///* 214 */         jar.setRecord(record);
//        }
//
///* 217 */       this.executorJarRepository.save(jar);
///* 218 */       return null;
///* 219 */     } catch (Exception e) {
///* 220 */       e.printStackTrace();
///* 221 */       log.error("@CreateExecutorJar: error is {}", e.getMessage());
///* 222 */       return BackBean.builder().status(false).message(e.getMessage()).build();
//      }
//    }
//
//
//
//
//
//
//    @GetMapping({"/getExecutorJarDetail"})
//    public BackBean<ExecutorJarEntity> getExecutorJarDetail(@RequestParam("id") String id) {
//      try {
///* 234 */       ExecutorJarEntity executorJarEntity = this.executorJarRepository.findById(id).get();
///* 235 */       return BackBean.builder().status(true).data(executorJarEntity).build();
///* 236 */     } catch (Exception e) {
///* 237 */       e.printStackTrace();
///* 238 */       log.error("@GetExecutorJarDetail: error is {}", e.getMessage());
///* 239 */       return BackBean.builder().status(false).message(e.getMessage()).build();
//      }
//    }
//
//
//
//
//
//    @GetMapping({"/getExecutorList"})
//    public BackBean<List> getExecutorList() {
//      try {
///* 250 */       List<ExecutorJarEntity> executors = this.executorJarRepository.findAll();
///* 251 */       return BackBean.builder().status(true).data(executors).build();
///* 252 */     } catch (Exception e) {
///* 253 */       e.printStackTrace();
///* 254 */       log.error("@GetExecutorList: error is {}", e.getMessage());
///* 255 */       return BackBean.builder().status(false).message(e.getMessage()).build();
//      }
//    }
//  }
//
//
///* Location:              C:\Users\admin\Desktop\xxm\zjg11\ZjgCaculate-v1.0.jar!\BOOT-INF\classes\cn\org\intelli\zffserver\controller\ExecutorJarController.class
// * Java compiler version: 8 (52.0)
// * JD-Core Version:       1.1.3
// */